#include "stdafx.h"
#include "LabelExample.h"

void LabelExample::loadFile(const String& fileName, FCView *view){
    FCUIXml::loadFile(fileName, view);
    //获取第二页
    FCTabPage *tabPage = getTabPage(L"TabPage2");
    FCLabel *label2 = new FCLabel();
    FCPoint point = {100,100};
    label2->setLocation(point);
    FCSize size = {100,20};
    label2->setSize(size);
    tabPage->addView(label2);
    label2->setText(L"标签");

    FCLinkLabel *linkLabel2 = new FCLinkLabel();
    FCPoint point2 = {100,200};
    linkLabel2->setLocation(point2);
    FCSize size2 = {100,20};
    linkLabel2->setSize(size2);
    tabPage->addView(linkLabel2);
    linkLabel2->setText(L"标签2");

    //从Xml中获取按钮
    FCLinkLabel *linkLabel = (FCLinkLabel*)getLabel(L"LinkLabel");
    //绑定按钮点击事件
    linkLabel->addEvent((FCTouchEventCallBack*)this, FCEventID_Click, this);
    linkLabel2->addEvent((FCTouchEventCallBack*)this, FCEventID_Click, this);
}

void LabelExample::callTouchEvent(String eventName, Object sender, FCTouchInfo touchInfo, Object invoke){
    FCLinkLabel *linkLabel = (FCLinkLabel*)sender;
}
